<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%= title %></title>
</head>
<body>

<%!
	String title = "Factorial";
	private int fact(int n) {
		int result = 1;
		if (n > 0) {
			for (int i = n; i > 0; i--) {
				result *= i;
			}
		} else if (n == 0) {
			return 1;
		} else {
			return -1;
		}
		return result;
	}
%>
<%
	// Java 주석
	/* java 주석2 */
	int n = 10;
	int f = fact(n);
%>

<%= n %>! = <%= f > 0 ? f : "N/A" %>

</body>
</html>